This replaces the current sample_data component of
x with value, if value is a
sample_data-class. However, if value
is a data.frame, then value is first
coerced to a sample_data-class, and then
assigned. Alternatively, if value is
phyloseq-class, then the
sample_data component will first be
accessed from value and then assigned. This makes
possible some concise assignment/replacement statements
when adjusting, modifying, or building subsets of
experiment-level data. See some examples below.
Internally, this re-builds the
phyloseq-class object using the standard
phyloseq constructor. Thus, index
mismatches between sample-describing components will not
be allowed, and subsetting will occurr automatically such
that only the intersection of sample IDs are included in
any components. This has the added benefit of re-checking
(internally) for any other issues.